package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;

class zaeu {
   private static final com.aspose.cells.b.c.a.za a = new com.aspose.cells.b.c.a.za(new String[]{"Subject", "LastAuthor", "Keywords", "Description", "Category", "Manager", "Company", "Version", "shapetype", "shape", "position", "margin-left", "margin-top", "width", "height", "z-index", "visibility", "imagedata", "ClientData", "MoveWithCells", "SizeWithCells", "Locked", "PrintObject", "CF", "AutoPict", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "font-style", "font-weight", "text-line-through", "text-underline-style", "color", "border-top", "border-right", "border-bottom", "border-left", "border", "background", "mso-pattern", "Left", "Center", "Right", "Blank", "Dash", "NA", "InPlace", "SheetEnd", "3", "5", "8", "9", "11", "12", "13", "43", "dateTime.tz", "boolean", "float", "string"});

   public static void a(zcfs var0, BuiltInDocumentPropertyCollection var1) {
      for(int var2 = 0; var2 < var0.a(); ++var2) {
         zcfl var3 = (zcfl)var0.a(var2);
         zcfs var4 = var3.j();

         for(int var5 = 0; var5 < var4.a(); ++var5) {
            zcfq var6 = var4.a(var5);
            if (!(var6 instanceof zcfv)) {
               zcfl var7 = (zcfl)var6;
               String var8 = var7.a();
               String var9 = var7.g;
               switch(a.a(var9)) {
               case 0:
                  var1.setSubject(var8);
                  break;
               case 1:
                  var1.setAuthor(var8);
                  break;
               case 2:
                  var1.setKeywords(var8);
                  break;
               case 3:
                  var1.setComments(var8);
                  break;
               case 4:
                  var1.setCategory(var8);
                  break;
               case 5:
                  var1.setManager(var8);
                  break;
               case 6:
                  var1.setCompany(var8);
                  break;
               case 7:
                  var1.setVersion(var8);
               }
            }
         }
      }

   }

   public static void a(zcfs var0, HashMap var1, String var2, IStreamProvider var3) throws Exception {
      for(int var4 = 0; var4 < var0.a(); ++var4) {
         zcfl var5 = (zcfl)var0.a(var4);
         zcfs var6 = var5.j();

         for(int var7 = 0; var7 < var6.a(); ++var7) {
            zcfq var8 = var6.a(var7);
            if (!(var8 instanceof zcfv)) {
               zcfl var9 = (zcfl)var8;
               String var10 = var9.g;
               switch(a.a(var10)) {
               case 8:
               default:
                  break;
               case 9:
                  zaex var11 = new zaex();
                  var11.a(var9.b("id"));
                  var11.c(var2);
                  a(var9.b("style"), var11);
                  a(var9.j(), var11, var2, var3);
                  var1.put(var11.a(), var11);
               }
            }
         }
      }

   }

   private static void a(String var0, zaex var1) {
      String[] var2 = com.aspose.cells.b.a.zv.d(var0, ';');
      String[] var3 = var2;
      int var4 = var2.length;

      for(int var5 = 0; var5 < var4; ++var5) {
         String var6 = var3[var5];
         String[] var7 = com.aspose.cells.b.a.zv.d(var6, ':');
         String var8 = f(var7[0]);
         switch(a.a(var8)) {
         case 10:
         case 15:
         case 16:
         default:
            break;
         case 11:
            var1.a(a(var7[1]));
            break;
         case 12:
            var1.b(a(var7[1]));
            break;
         case 13:
            var1.c(a(var7[1]));
            break;
         case 14:
            var1.d(a(var7[1]));
         }
      }

   }

   private static void a(zcfs var0, zaex var1, String var2, IStreamProvider var3) throws Exception {
      for(int var4 = 0; var4 < var0.a(); ++var4) {
         zcfq var5 = var0.a(var4);
         if (!(var5 instanceof zcfv)) {
            zcfl var6 = (zcfl)var5;
            String var7 = var6.g;
            switch(a.a(var7)) {
            case 17:
               String var8 = var6.b("src");
               var1.b(var2 + var8);
               if (!com.aspose.cells.b.a.d.zd.c(var1.c())) {
                  StreamProviderOptions var9 = new StreamProviderOptions();
                  var9.a = var8;
                  var9.b = var1.c();
                  var3.initStream(var9);
                  com.aspose.cells.b.a.d.zm var10 = var9.c;
                  if (var10 != null) {
                     var1.a(var10);
                  }
               } else {
                  com.aspose.cells.b.a.d.ze var11 = com.aspose.cells.b.a.d.zd.b(var1.c());
                  var1.a((com.aspose.cells.b.a.d.zm)var11);
               }
               break;
            case 18:
               a(var6.j(), var1);
            }
         }
      }

   }

   private static void a(zcfs var0, zaex var1) {
      for(int var2 = 0; var2 < var0.a(); ++var2) {
         zcfq var3 = var0.a(var2);
         if (!(var3 instanceof zcfv)) {
            zcfl var4 = (zcfl)var3;
            String var5 = var4.g;
            switch(a.a(var5)) {
            case 19:
               var1.e(0);
               break;
            case 20:
               if (var1.i() != 0) {
                  var1.e(1);
               }
               break;
            case 21:
               var1.a(Boolean.parseBoolean(var4.a()));
               break;
            case 22:
               var1.b(Boolean.parseBoolean(var4.a()));
            case 23:
            case 24:
            }
         }
      }

   }

   public static int a(String var0) {
      if (var0.toLowerCase().indexOf("pt") > -1) {
         return (int)(com.aspose.cells.b.a.zn.a(var0.substring(0, 0 + (var0.length() - 2))) * 96.0D / 72.0D + 0.005D);
      } else if (var0.toLowerCase().indexOf("in") > -1) {
         return (int)(com.aspose.cells.b.a.zn.a(var0.substring(0, 0 + (var0.length() - 2))) * 96.0D);
      } else {
         return var0.toLowerCase().indexOf("px") > -1 ? (int)com.aspose.cells.b.a.zn.a(var0.substring(0, 0 + (var0.length() - 2))) : (int)com.aspose.cells.b.a.zn.a(var0);
      }
   }

   public static double b(String var0) {
      if (var0.toLowerCase().indexOf("pt") > -1) {
         return com.aspose.cells.b.a.zn.a(var0.substring(0, 0 + (var0.length() - 2)));
      } else if (var0.toLowerCase().indexOf("px") > -1) {
         return com.aspose.cells.b.a.zn.a(var0.substring(0, 0 + (var0.length() - 2))) * 72.0D / 92.0D;
      } else {
         return var0.toLowerCase().indexOf("in") > -1 ? com.aspose.cells.b.a.zn.a(var0.substring(0, 0 + (var0.length() - 2))) * 72.0D : com.aspose.cells.b.a.zn.a(var0);
      }
   }

   public static int c(String var0) {
      if (var0.toLowerCase().indexOf("pt") > -1) {
         return (int)com.aspose.cells.b.a.zn.a(var0.substring(0, 0 + (var0.length() - 2)));
      } else if (var0.toLowerCase().indexOf("px") > -1) {
         return (int)(com.aspose.cells.b.a.zn.a(var0.substring(0, 0 + (var0.length() - 2))) * 72.0D / 92.0D);
      } else {
         return var0.toLowerCase().indexOf("in") > -1 ? (int)(com.aspose.cells.b.a.zn.a(var0.substring(0, 0 + (var0.length() - 2))) * 72.0D) : (int)com.aspose.cells.b.a.zn.a(var0);
      }
   }

   public static boolean d(String var0) {
      switch(a.a(var0.toLowerCase())) {
      case 25:
      case 26:
      case 27:
      case 28:
      case 29:
      case 30:
      case 31:
      case 32:
      case 33:
         return true;
      default:
         return false;
      }
   }

   public static double e(String var0) {
      switch(a.a(var0.toLowerCase())) {
      case 25:
         return 0.8D;
      case 26:
         return 1.0D;
      case 27:
         return 1.2D;
      case 28:
         return 1.4D;
      case 29:
         return 1.8D;
      case 30:
         return 2.4D;
      case 31:
         return 3.6D;
      case 32:
         return 1.2D;
      case 33:
         return 0.75D;
      default:
         return 1.0D;
      }
   }

   public static void a(String var0, Font var1) {
      var0 = com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(var0, "\"", ""), "'", "");
      String[] var2 = com.aspose.cells.b.a.zv.d(var0, ',');
      if (var2.length > 1) {
         var1.setName(var2[0]);
      } else {
         var1.setName(var0);
      }

   }

   public static String f(String var0) {
      return com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(var0, "\t", ""), "\n", ""), "\r", ""), " ", "");
   }

   public static void a(zcfk var0, Workbook var1) {
      zcfs var2 = var0.e("x:HideWorkbookTabs");
      var1.getSettings().setShowTabs(var2.a() <= 0);
      zcfs var3 = var0.e("x:HideHorizontalScrollBar");
      var1.getSettings().setHScrollBarVisible(var3.a() <= 0);
      zcfs var4 = var0.e("x:HideVerticalScrollBar");
      var1.getSettings().setVScrollBarVisible(var4.a() <= 0);
   }

   public static void a(zcfk var0, zaev var1) throws Exception {
      zcfs var2 = var0.e("x:WorksheetOptions");
      if (var2.a() > 0) {
         for(int var3 = 0; var3 < var2.a(); ++var3) {
            zcfl var4 = (zcfl)var2.a(var3);
            zcfs var5 = var4.e("x:DoNotDisplayGridlines");
            if (var5.a() > 0) {
               var1.E().setGridlinesVisible(false);
            } else {
               var1.E().setGridlinesVisible(true);
            }

            zcfs var6 = var4.e("x:TopRowVisible");
            if (var6.a() > 0) {
               var1.E().setFirstVisibleRow(com.aspose.cells.b.a.ze.f(zass.a(var6.a(0))));
            }

            zcfs var7 = var4.e("x:LeftColumnVisible");
            if (var7.a() > 0) {
               var1.E().setFirstVisibleColumn(com.aspose.cells.b.a.ze.f(zass.a(var7.a(0))));
            }

            zcfs var8 = var4.e("x:FreezePanes");
            if (var8.a() > 0) {
               a(var4, var1.E());
            }

            zcfs var9 = var4.e("x:DefaultRowHeight");
            if (var9.a() > 0) {
               double var10 = com.aspose.cells.b.a.ze.g(zass.a(var9.a(0))) / 15.0D;
               var1.E().getCells().setStandardHeight(var10 * (double)zaer.c / (double)zaer.e);
            }

            zcfs var17 = var4.e("x:StandardWidth");
            if (var17.a() > 0) {
               ;
            }

            zcfs var11 = var4.e("x:Zoom");
            if (var11.a() > 0) {
               var1.E().setZoom(com.aspose.cells.b.a.ze.d(var11.a(0).a()));
            }

            zcfs var12 = var4.e("x:TabColorIndex");
            if (var12.a() > 0) {
               int var13 = com.aspose.cells.b.a.ze.f(zass.a(var12.a(0)));
               var1.E().e(var13);
            }

            zcfs var18 = var4.e("x:DoNotDisplayHeadings");
            if (var18.a() > 0) {
               var1.E().setRowColumnHeadersVisible(false);
            }

            zcfs var14 = var4.e("x:Visible");
            if (var14.a() > 0) {
               String var15 = zass.a(var14.a(0));
               if (!var15.equals("SheetHidden") && !var15.equals("SheetVeryHidden")) {
                  var1.E().setVisible(true);
               } else {
                  var1.E().setVisible(false);
               }
            }

            zcfs var19 = var4.e("x:ShowPageBreakZoom");
            if (var19.a() > 0) {
               var1.E().setPageBreakPreview(true);
               zcfs var16 = var4.e("x:PageBreakZoom");
               if (var16.a() > 0) {
                  var1.E().setZoom(com.aspose.cells.b.a.ze.f(zass.a(var16.a(0))));
               }
            }

            c(var0, var1);
         }
      }

   }

   public static void b(zcfk var0, zaev var1) {
      Worksheet var2 = var1.E();
      zcfs var3 = var0.e("x:ConditionalFormatting");
      ConditionalFormattingCollection var4 = var2.getConditionalFormattings();
      FormatConditionCollection var5 = null;
      zcfl var6 = null;
      if (null != var3 && var3.a() > 0) {
         for(int var7 = 0; var7 < var3.a(); ++var7) {
            var6 = (zcfl)var3.a(var7);
            var5 = var4.get(var4.add());
            a(var6, var5, var2);
         }
      }

   }

   private static void a(zcfl var0, FormatConditionCollection var1, Worksheet var2) {
      zcfs var3 = null;
      zcfl var4 = null;
      var3 = var0.e("x:Range");
      String var5;
      int var12;
      String var13;
      if (null != var3 && var3.a() > 0) {
         var5 = zass.a(var3.a(0));
         String[] var6 = com.aspose.cells.b.a.zv.d(var5, ',');
         com.aspose.cells.b.a.g.a.ze var9 = new com.aspose.cells.b.a.g.a.ze("\\$?[a-zA-Z]{1,3}:\\$?[a-zA-Z]{1,3}");
         String[] var10 = var6;
         int var11 = var6.length;

         for(var12 = 0; var12 < var11; ++var12) {
            var13 = var10[var12];
            CellArea var7;
            if (var9.d(var13.trim())) {
               Range var8 = var2.getCells().createRange(var13);
               var7 = CellArea.createCellArea(var8.getFirstRow(), var8.getFirstColumn(), var8.getRowCount(), var8.getColumnCount());
            } else {
               var7 = (CellArea)CellArea.a(var13.trim(), true);
            }

            var1.addArea(var7);
         }
      }

      var3 = var0.e("x:Condition");
      if (null != var3 && var3.a() > 0) {
         var5 = "";
         String var16 = "";
         String var17 = "";
         String var18 = "";
         boolean var19 = true;
         boolean var21 = false;
         HashMap var23 = new HashMap();
         var13 = null;

         for(int var14 = 0; var14 < var3.a(); ++var14) {
            var4 = (zcfl)var3.a(var14);
            var5 = b(var4.e("x:Qualifier"));
            var16 = b(var4.e("x:Value1"));
            if (null != var16 && !"".equals(var16)) {
               var16 = "=" + zaff.b(var16);
            }

            var17 = b(var4.e("x:Value2"));
            if (null != var17 && !"".equals(var17)) {
               var17 = "=" + zaff.b(var17);
            }

            var18 = a(var4.e("x:Format"));
            HashMap[] var15 = new HashMap[]{var23};
            a(var18, var15);
            var23 = var15[0];
            int var20;
            byte var22;
            if (null != var5 && !"".equals(var5.trim())) {
               var20 = zbbx.a(var5);
               var22 = 0;
            } else {
               var22 = 1;
               var20 = 6;
            }

            var12 = var1.addCondition(var22, var20, var16, var17);
            FormatCondition var24 = var1.get(var12);
            a(var23, var24);
         }
      }

   }

   private static void a(HashMap var0, FormatCondition var1) {
      String var2 = "";
      String var3 = "";
      String var4 = "";
      String var5 = "";
      String var6 = "";
      String var7 = "";
      boolean var8 = false;
      ArrayList var9 = new ArrayList(var0.keySet());

      for(int var10 = 0; var10 < var9.size(); ++var10) {
         var2 = (String)var9.get(var10);
         var3 = (String)var0.get(var2);
         int var11;
         switch(a.a(var2)) {
         case 34:
            var1.getStyle().getFont().setItalic("italic".equals(var3));
            break;
         case 35:
            var1.getStyle().getFont().setBold("700".equals(var3));
            break;
         case 36:
            var1.getStyle().getFont().setStrikeout("single".equals(var3));
            break;
         case 37:
            var1.getStyle().getFont().setUnderline(zbbx.b(var3));
            break;
         case 38:
            var1.getStyle().getFont().setColor(zase.aJ(var3));
            break;
         case 39:
            if (-1 == var3.toLowerCase().indexOf("none")) {
               var11 = var3.lastIndexOf(32);
               var5 = var3.substring(var11).trim();
               var4 = var3.substring(0, 0 + (var3.length() - var5.length())).trim();
            } else {
               var5 = "#000000";
               var4 = "none";
            }

            var1.getStyle().getBorders().getByBorderType(4).setLineStyle(zbbx.d(var4));
            var1.getStyle().getBorders().getByBorderType(4).setColor(g(var5));
            break;
         case 40:
            if (-1 == var3.toLowerCase().indexOf("none")) {
               var11 = var3.lastIndexOf(32);
               var5 = var3.substring(var11).trim();
               var4 = var3.substring(0, 0 + (var3.length() - var5.length())).trim();
            } else {
               var5 = "#000000";
               var4 = "none";
            }

            var1.getStyle().getBorders().getByBorderType(2).setLineStyle(zbbx.d(var4));
            var1.getStyle().getBorders().getByBorderType(2).setColor(g(var5));
            break;
         case 41:
            if (-1 == var3.toLowerCase().indexOf("none")) {
               var11 = var3.lastIndexOf(32);
               var5 = var3.substring(var11).trim();
               var4 = var3.substring(0, 0 + (var3.length() - var5.length())).trim();
            } else {
               var5 = "#000000";
               var4 = "none";
            }

            var1.getStyle().getBorders().getByBorderType(8).setLineStyle(zbbx.d(var4));
            var1.getStyle().getBorders().getByBorderType(8).setColor(g(var5));
            break;
         case 42:
            if (-1 == var3.toLowerCase().indexOf("none")) {
               var11 = var3.lastIndexOf(32);
               var5 = var3.substring(var11).trim();
               var4 = var3.substring(0, 0 + (var3.length() - var5.length())).trim();
            } else {
               var5 = "#000000";
               var4 = "none";
            }

            var1.getStyle().getBorders().getByBorderType(1).setLineStyle(zbbx.d(var4));
            var1.getStyle().getBorders().getByBorderType(1).setColor(g(var5));
            break;
         case 43:
            if (-1 == var3.toLowerCase().indexOf("none")) {
               var11 = var3.lastIndexOf(32);
               var5 = var3.substring(var11).trim();
               var4 = var3.substring(0, 0 + (var3.length() - var5.length())).trim();
            } else {
               var5 = "#000000";
               var4 = "none";
            }

            var1.getStyle().getBorders().getByBorderType(4).setLineStyle(zbbx.d(var4));
            var1.getStyle().getBorders().getByBorderType(4).setColor(g(var5));
            var1.getStyle().getBorders().getByBorderType(2).setLineStyle(zbbx.d(var4));
            var1.getStyle().getBorders().getByBorderType(2).setColor(g(var5));
            var1.getStyle().getBorders().getByBorderType(8).setLineStyle(zbbx.d(var4));
            var1.getStyle().getBorders().getByBorderType(8).setColor(g(var5));
            var1.getStyle().getBorders().getByBorderType(1).setLineStyle(zbbx.d(var4));
            var1.getStyle().getBorders().getByBorderType(1).setColor(g(var5));
            break;
         case 44:
            var1.getStyle().setBackgroundColor(g(var3));
            break;
         case 45:
            var11 = var3.lastIndexOf(32);
            if (-1 != var11 && !"auto".equals(var3)) {
               if (-1 != var11) {
                  var6 = var3.substring(var11).trim();
                  var7 = var3.substring(0, 0 + (var3.length() - var6.length())).trim();
                  var1.getStyle().setPattern(zbbx.e(var6));
                  var1.getStyle().setForegroundColor(g(var7));
               }
            } else {
               var1.getStyle().setPattern(0);
               var1.getStyle().setForegroundColor(Color.getBlack());
            }
         }
      }

   }

   private static Color g(String var0) {
      Color var1 = Color.getBlack();
      if (-1 != var0.indexOf(35)) {
         var1 = zase.t(com.aspose.cells.b.a.zv.a(var0, "#", ""));
      } else {
         var1 = zase.aJ(var0);
      }

      return var1;
   }

   private static void a(String var0, HashMap[] var1) {
      var0 = var0.trim();
      var1[0].clear();
      String[] var2 = com.aspose.cells.b.a.zv.d(var0, ';');
      String[] var3 = null;

      for(int var4 = 0; var4 < var2.length; ++var4) {
         var2[var4] = var2[var4].trim();
         if (null != var2[var4] && !"".equals(var2[var4])) {
            var3 = com.aspose.cells.b.a.zv.d(var2[var4], ':');
            var3[0] = var3[0].trim();
            if (null != var3[0] && !"".equals(var3[0])) {
               var1[0].put(var3[0], var3[1].trim());
            }
         }
      }

   }

   private static String a(zcfs var0) {
      String var1 = "";
      if (null != var0 && var0.a() > 0) {
         var1 = zass.a((zcfl)var0.a(0), "Style").h;
      }

      return var1;
   }

   private static String b(zcfs var0) {
      String var1 = "";
      if (null != var0 && var0.a() > 0) {
         var1 = zass.a(var0.a(0));
      }

      return var1;
   }

   private static void c(zcfk var0, zaev var1) throws Exception {
      Worksheet var2 = var1.E();
      zcfs var3 = null;
      var3 = var0.e("x:Scale");
      var2.getPageSetup().setZoom(a(var3, 100));
      var3 = var0.e("x:FitWidth");
      var2.getPageSetup().setFitToPagesWide(a(var3, 1));
      var3 = var0.e("x:FitHeight");
      var2.getPageSetup().setFitToPagesTall(a(var3, 1));
      var3 = var0.e("x:PaperSizeIndex");
      var2.getPageSetup().setPaperSize(g(var3));
      var3 = var0.e("x:HorizontalResolution");
      var2.getPageSetup().setPrintQuality(a(var3, 300));
      var3 = var0.e("x:VerticalResolution");
      var2.getPageSetup().setPrintQuality(a(var3, 300));
      var3 = var0.e("x:Selected");
      var2.setSelected(null != var3 && 1 == var3.a());
      var3 = var0.e("x:FitToPage");
      var2.getPageSetup().setPercentScale(null == var3 || 0 == var3.a());
      var3 = var0.e("x:LeftToRight");
      var2.getPageSetup().setOrder(f(var3));
      var3 = var0.e("x:BlackAndWhite");
      var2.getPageSetup().setBlackAndWhite(e(var3));
      var3 = var0.e("x:DraftQuality");
      var2.getPageSetup().setPrintDraft(e(var3));
      var3 = var0.e("x:Gridlines");
      var2.getPageSetup().setPrintGridlines(e(var3));
      var3 = var0.e("x:RowColHeadings");
      var2.getPageSetup().setPrintHeadings(e(var3));
      var3 = var0.e("x:CommentsLayout");
      var2.getPageSetup().setPrintComments(d(var3));
      var3 = var0.e("x:PrintErrors");
      var2.getPageSetup().setPrintErrors(c(var3));
      a(var0, var1, false);
      a(var0, var1, true);
   }

   private static void a(zcfk var0, zaev var1, boolean var2) throws Exception {
      Worksheet var3 = var1.E();
      zcfs var4 = null;
      if (var2) {
         var4 = var0.e("x:HeaderPicture");
      } else {
         var4 = var0.e("x:FooterPicture");
      }

      if (null != var4) {
         zcfl var5 = null;
         zcfs var6 = null;
         Picture var7 = null;
         String var8 = "";
         com.aspose.cells.b.a.d.ze var9 = null;
         Object var10 = null;
         String var11 = "";
         String var12 = var1.a().b();

         for(int var13 = 0; var13 < var4.a(); ++var13) {
            var5 = (zcfl)var4.a(var13);
            var6 = var5.e("x:Location");
            if (null != var6 && var6.a() > 0) {
               var11 = zass.a(var6.a(0));
            }

            var6 = var5.e("x:Source");
            if (null != var6 && var6.a() > 0) {
               var8 = zass.a(var6.a(0));
               if (null != var8 && !"".equals(var8)) {
                  if (var8.startsWith("file:///")) {
                     var8 = zaer.c(var8);
                  } else if (!"".equals(com.aspose.cells.b.a.d.zk.e(var8)) && null != com.aspose.cells.b.a.d.zk.e(var8)) {
                     var8 = var1.a().a() + var8;
                  } else {
                     var8 = var12.substring(0, 0 + (var12.length() - var12.substring(var12.lastIndexOf(46)).length())) + "_files" + com.aspose.cells.b.a.d.zk.a + zaer.c(var8);
                  }

                  if (!com.aspose.cells.b.a.d.zd.c(var8)) {
                     var8 = com.aspose.cells.b.a.zv.a(var8, "_files", ".files");
                  }

                  var9 = new com.aspose.cells.b.a.d.ze(var8, 3, 1);
                  byte[] var14 = new byte[(int)var9.h()];
                  var9.a((byte[])var14, 0, (int)var9.h());
                  switch(a.a(var11)) {
                  case 46:
                     var7 = var2 ? var3.getPageSetup().setHeaderPicture(0, var14) : var3.getPageSetup().setFooterPicture(0, var14);
                     break;
                  case 47:
                     var7 = var2 ? var3.getPageSetup().setHeaderPicture(1, var14) : var3.getPageSetup().setFooterPicture(1, var14);
                     break;
                  case 48:
                     var7 = var2 ? var3.getPageSetup().setHeaderPicture(2, var14) : var3.getPageSetup().setFooterPicture(2, var14);
                  }

                  var9.a();
               }
            }

            var6 = var5.e("x:Height");
            if (null != var6 && var6.a() > 0) {
               var7.setHeight((int)com.aspose.cells.b.a.ze.g(zass.a(var6.a(0))));
            }

            var6 = var5.e("x:Width");
            if (null != var6 && var6.a() > 0) {
               var7.setWidth((int)com.aspose.cells.b.a.ze.g(zass.a(var6.a(0))));
            }

            var6 = var5.e("x:CropTop");
            if (null != var6 && var6.a() > 0) {
               var7.getFormatPicture().setTopCrop(com.aspose.cells.b.a.ze.g(zass.a(var6.a(0))));
            }

            var6 = var5.e("x:CropRight");
            if (null != var6 && var6.a() > 0) {
               var7.getFormatPicture().setRightCrop(com.aspose.cells.b.a.ze.g(zass.a(var6.a(0))));
            }

            var6 = var5.e("x:CropLeft");
            if (null != var6 && var6.a() > 0) {
               var7.getFormatPicture().setLeftCrop(com.aspose.cells.b.a.ze.g(zass.a(var6.a(0))));
            }

            var6 = var5.e("x:CropBottom");
            if (null != var6 && var6.a() > 0) {
               var7.getFormatPicture().setBottomCrop(com.aspose.cells.b.a.ze.g(zass.a(var6.a(0))));
            }

            var6 = var5.e("x:Brightness");
            if (null != var6 && var6.a() > 0) {
               var7.getFormatPicture().setBrightness(com.aspose.cells.b.a.ze.g(zass.a(var6.a(0))));
            }

            var6 = var5.e("x:Contrast");
            if (null != var6 && var6.a() > 0) {
               var7.getFormatPicture().setContrast(com.aspose.cells.b.a.ze.g(zass.a(var6.a(0))));
            }

            var6 = var5.e("x:ColorType");
            if (null != var6 && var6.a() > 0) {
               if ("BlackAndWhite".equals(zass.a(var6.a(0)))) {
                  var7.getFormatPicture().setBiLevel(true);
                  var7.getFormatPicture().setGray(true);
               }

               if ("Grayscale".equals(zass.a(var6.a(0)))) {
                  var7.getFormatPicture().setGray(true);
                  var7.getFormatPicture().setBiLevel(false);
               }
            }

            var6 = var5.e("x:LockAspectRatio");
            var7.setLockAspectRatio(null != var6 && var6.a() > 0);
         }

      }
   }

   private static int c(zcfs var0) {
      byte var1 = 2;
      if (null != var0 && 1 == var0.a()) {
         switch(a.a(var0.a(0).a())) {
         case 49:
            var1 = 0;
            break;
         case 50:
            var1 = 1;
            break;
         case 51:
            var1 = 3;
         }
      }

      return var1;
   }

   private static int d(zcfs var0) {
      byte var1 = 1;
      if (null != var0 && 1 == var0.a()) {
         switch(a.a(var0.a(0).a())) {
         case 52:
            var1 = 0;
            break;
         case 53:
            var1 = 2;
         }
      }

      return var1;
   }

   private static boolean e(zcfs var0) {
      return null != var0 && 1 == var0.a();
   }

   private static int f(zcfs var0) {
      return null != var0 && 1 == var0.a() ? 1 : 0;
   }

   private static int g(zcfs var0) {
      if (null != var0 && 1 == var0.a()) {
         switch(a.a(var0.a(0).a())) {
         case 54:
            return 3;
         case 55:
            return 5;
         case 56:
            return 8;
         case 57:
            return 9;
         case 58:
            return 11;
         case 59:
            return 12;
         case 60:
            return 13;
         case 61:
            return 43;
         default:
            return 9;
         }
      } else {
         return 9;
      }
   }

   private static int a(zcfs var0, int var1) {
      boolean var2 = false;
      int var3;
      if (null != var0 && 1 == var0.a()) {
         var3 = com.aspose.cells.b.a.ze.f(var0.a(0).a());
      } else {
         var3 = var1;
      }

      return var3;
   }

   private static void a(zcfl var0, Worksheet var1) {
      int var2 = 0;
      int var3 = 0;
      int var4 = 0;
      int var5 = 0;
      zcfs var6 = var0.e("x:SplitHorizontal");
      if (var6.a() > 0) {
         var4 = com.aspose.cells.b.a.ze.f(zass.a(var6.a(0)));
      }

      zcfs var7 = var0.e("x:TopRowBottomPane");
      if (var7.a() > 0) {
         var2 = com.aspose.cells.b.a.ze.f(zass.a(var7.a(0)));
      }

      zcfs var8 = var0.e("x:SplitVertical");
      if (var8.a() > 0) {
         var5 = com.aspose.cells.b.a.ze.f(zass.a(var8.a(0)));
      }

      zcfs var9 = var0.e("x:LeftColumnRightPane");
      if (var9.a() > 0) {
         var3 = com.aspose.cells.b.a.ze.f(zass.a(var9.a(0)));
      }

      var1.freezePanes(var2, var3, var4, var5);
   }

   public static void a(zcfs var0, CustomDocumentPropertyCollection var1) throws Exception {
      for(int var2 = 0; var2 < var0.a(); ++var2) {
         zcfl var3 = (zcfl)var0.a(var2);
         zcfs var4 = var3.j();

         for(int var5 = 0; var5 < var4.a(); ++var5) {
            zcfq var6 = var4.a(var5);
            if (!(var6 instanceof zcfv)) {
               zcfl var7 = (zcfl)var6;
               String var8 = var7.b("dt:dt");
               a(var7.g, var7.a(), var8, var1);
            }
         }
      }

   }

   private static void a(String var0, String var1, String var2, CustomDocumentPropertyCollection var3) throws Exception {
      var0 = h(var0);
      switch(a.a(var2)) {
      case 62:
         String var6 = zaer.b(var1);
         DateTime var5 = DateTime.a(var6);
         var3.add(var0, var5);
         break;
      case 63:
         var3.add(var0, var1.equals("1"));
         break;
      case 64:
         double var4 = com.aspose.cells.b.a.ze.g(var1);
         var3.add(var0, var4);
         break;
      case 65:
         var3.add(var0, var1);
      }

   }

   private static String h(String var0) {
      StringBuilder var1 = new StringBuilder();
      if (var0.startsWith("o:")) {
         var0 = var0.substring(2);
      }

      int var2 = var0.length();

      for(int var3 = 0; var3 < var2; ++var3) {
         char var4 = var0.charAt(var3);
         if (var4 == '_' && var3 + 6 < var2 && var0.charAt(var3 + 1) == 'x' && var0.charAt(var3 + 6) == '_') {
            boolean var5 = true;
            StringBuilder var6 = new StringBuilder();

            int var7;
            char var8;
            for(var7 = var3 + 2; var7 < var3 + 6; ++var7) {
               var8 = var0.charAt(var7);
               if (!a(var8)) {
                  var5 = false;
                  break;
               }

               var6.append(var0.charAt(var7));
            }

            if (var5) {
               var7 = com.aspose.cells.b.a.ze.b(com.aspose.cells.b.a.zr.a(var6), 16);
               var8 = (char)var7;
               var1.append(var8);
               var3 += 6;
            } else {
               var1.append(var4);
            }
         } else {
            var1.append(var4);
         }
      }

      return com.aspose.cells.b.a.zr.a(var1);
   }

   private static boolean a(char var0) {
      return var0 >= '0' && var0 <= '9' || var0 >= 'a' && var0 <= 'f' || var0 >= 'A' && var0 <= 'F';
   }
}
